#pragma once

#include <stdio.h>
#include <stdlib.h>
#include<assert.h>
#include<stdbool.h>
typedef  int HeapDataType;

typedef  struct Heap
{
	HeapDataType* a;
	int size;
	int capacity;
}HP;

void HeapInit(HP* hp);

void HeapDestroy(HP* hp);

void HeapPush(HP* hp, HeapDataType x);

void Swap(HeapDataType* px, HeapDataType* py);

void HeapPop(HP* hp);

bool HeapEmpty(HP* hp);

void AdjustDown(int* a, int size, int parent);

void PrintHeap(HP* hp);

int HeapTop(HP* hp);

void HeapSort(int* a, int n);


